home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / paren.arc / PAREN.DOC next >
Text File  |  1987-03-27  |  4KB  |  133 lines

  1.  
  2.  
  3.  
  4.      PPPPAAAARRRREEEENNNN((((1111LLLL))))           UUUUNNNNIIIIXXXX SSSSYYYYSSSSTTTTEEEEMMMM VVVV ((((OOOOSSSS LLLLooooccccaaaallll))))            PPPPAAAARRRREEEENNNN((((1111LLLL))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           paren - C program checker
  10.  
  11.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.           paren [-adfv] [-t tabsize] file ...
  13.  
  14.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  15.           Several common bugs in C language programs are  not  flagged
  16.           by  the  C  compiler  (cc) and static analyzer (lint).  Some
  17.           versions of lint flag some of these errors.  Paren helps  to
  18.           find some of these common errors.  These include:
  19.  
  20.               Comparison taking precedence over assignment
  21.  
  22.               Comparison taking precedence over bitwise operators
  23.  
  24.               Assignment in a conditional context
  25.  
  26.               Bitwise or in a conditional context
  27.  
  28.               Inappropriate operator usage
  29.  
  30.               Use of =op instead of op=
  31.  
  32.               Unusual operator adjacency
  33.  
  34.               Extra semicolons after else if for and while
  35.  
  36.               Dangling else
  37.  
  38.               Nesting comments and
  39.  
  40.               EOF before end of comments or strings
  41.  
  42.           The -a (assignment) option will flag possible errors  caused
  43.           by  assignments  in  conditionals (if, while, and for).  For
  44.           example:
  45.  
  46.                   if (*cp = 'Z')
  47.  
  48.           Unfortunately that the widely used idiom:
  49.  
  50.                   while (*p1++ = *p2++);
  51.  
  52.           will also be flagged as a possible error.
  53.  
  54.           The -d (debug) option is available only if paren is compiled
  55.           with -DDEBUG.
  56.  
  57.           The -f (fortran) option recognizes the comparison  operators
  58.           LT  LE  LEQ  GT  GE GEQ EQ NEQ, the logical operators OR and
  59.           AND, and the keywords CASE DO ELSE IF FOR SWITCH WHILE.
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 3/27/87)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      PPPPAAAARRRREEEENNNN((((1111LLLL))))           UUUUNNNNIIIIXXXX SSSSYYYYSSSSTTTTEEEEMMMM VVVV ((((OOOOSSSS LLLLooooccccaaaallll))))            PPPPAAAARRRREEEENNNN((((1111LLLL))))
  71.  
  72.  
  73.  
  74.           The -t tabsize option defines the number of  characters  per
  75.           tabstop.  The default tabsize is 8.
  76.  
  77.           The -v (verbose) option forces some possible  errors  to  be
  78.           flagged  even  when they do not occur in parenthesis.  These
  79.           are probably not errors so the default is to not flag them.
  80.  
  81.           Paren is fast so it could be called from lint without  great
  82.           penalty.  If you are examining a large volume of code try:
  83.  
  84.                   find directory -name '*.[ch]' -a -print |
  85.                           xargs paren [-afv] [-t tabsize]
  86.  
  87.  
  88.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  89.           lint, "The C Programming Language" by Kernighan and Ritchie.
  90.  
  91.      DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  92.           Self explanatory.
  93.  
  94.      BBBBUUUUGGGGSSSS
  95.           Some possible errors are not detected, in particular:
  96.  
  97.                   x = (struct X *) p + 1;
  98.  
  99.           probably ought to be:
  100.  
  101.                x = (struct X *)(p + 1);
  102.  
  103.           and
  104.  
  105.                a = i << j + k;
  106.  
  107.           probably ought to be:
  108.  
  109.                a = (i << j) + k;
  110.  
  111.           Programs with gross syntactic  errors  may  cause  paren  to
  112.           abort.
  113.  
  114.           Since preprocessor  expansion  is  not  done  some  possible
  115.           errors won't be detected, while others are detected that the
  116.           preprocessor would remove.
  117.  
  118.           The error messages can be misleading, and the  line  printed
  119.           may not be the one the error actually occurred on.
  120.  
  121.           Paren does not know about the ?: operator.
  122.  
  123.           Paren can't fix your programs.
  124.  
  125.  
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 3/27/87)
  130.  
  131.  
  132.  
  133.